package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Lesson;
import com.es.disped.dao.model.LessonExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface LessonMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @SelectProvider(type=LessonSqlProvider.class, method="countByExample")
    long countByExample(LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @DeleteProvider(type=LessonSqlProvider.class, method="deleteByExample")
    int deleteByExample(LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Delete({
        "delete from lesson",
        "where lesson_id = #{lessonId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String lessonId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Insert({
        "insert into lesson (lesson_id, lesson_name, ",
        "lesson_index, syllabus_id, ",
        "syllabus_name, lesson_begin_time, ",
        "lesson_end_time, lesson_valid, ",
        "lesson_content)",
        "values (#{lessonId,jdbcType=CHAR}, #{lessonName,jdbcType=VARCHAR}, ",
        "#{lessonIndex,jdbcType=INTEGER}, #{syllabusId,jdbcType=CHAR}, ",
        "#{syllabusName,jdbcType=VARCHAR}, #{lessonBeginTime,jdbcType=VARCHAR}, ",
        "#{lessonEndTime,jdbcType=VARCHAR}, #{lessonValid,jdbcType=INTEGER}, ",
        "#{lessonContent,jdbcType=LONGVARCHAR})"
    })
    int insert(Lesson record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @InsertProvider(type=LessonSqlProvider.class, method="insertSelective")
    int insertSelective(Lesson record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @SelectProvider(type=LessonSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_index", property="lessonIndex", jdbcType=JdbcType.INTEGER),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_begin_time", property="lessonBeginTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_end_time", property="lessonEndTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_valid", property="lessonValid", jdbcType=JdbcType.INTEGER),
        @Result(column="lesson_content", property="lessonContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Lesson> selectByExampleWithBLOBs(LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @SelectProvider(type=LessonSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_index", property="lessonIndex", jdbcType=JdbcType.INTEGER),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_begin_time", property="lessonBeginTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_end_time", property="lessonEndTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_valid", property="lessonValid", jdbcType=JdbcType.INTEGER)
    })
    List<Lesson> selectByExample(LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Select({
        "select",
        "lesson_id, lesson_name, lesson_index, syllabus_id, syllabus_name, lesson_begin_time, ",
        "lesson_end_time, lesson_valid, lesson_content",
        "from lesson",
        "where lesson_id = #{lessonId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_index", property="lessonIndex", jdbcType=JdbcType.INTEGER),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_begin_time", property="lessonBeginTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_end_time", property="lessonEndTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_valid", property="lessonValid", jdbcType=JdbcType.INTEGER),
        @Result(column="lesson_content", property="lessonContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    Lesson selectByPrimaryKey(String lessonId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=LessonSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Lesson record, @Param("example") LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=LessonSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Lesson record, @Param("example") LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=LessonSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Lesson record, @Param("example") LessonExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @UpdateProvider(type=LessonSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Lesson record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Update({
        "update lesson",
        "set lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "lesson_index = #{lessonIndex,jdbcType=INTEGER},",
          "syllabus_id = #{syllabusId,jdbcType=CHAR},",
          "syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "lesson_begin_time = #{lessonBeginTime,jdbcType=VARCHAR},",
          "lesson_end_time = #{lessonEndTime,jdbcType=VARCHAR},",
          "lesson_valid = #{lessonValid,jdbcType=INTEGER},",
          "lesson_content = #{lessonContent,jdbcType=LONGVARCHAR}",
        "where lesson_id = #{lessonId,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Lesson record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table lesson
     *
     * @mbg.generated Sat Jul 06 14:21:08 CST 2019
     */
    @Update({
        "update lesson",
        "set lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "lesson_index = #{lessonIndex,jdbcType=INTEGER},",
          "syllabus_id = #{syllabusId,jdbcType=CHAR},",
          "syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "lesson_begin_time = #{lessonBeginTime,jdbcType=VARCHAR},",
          "lesson_end_time = #{lessonEndTime,jdbcType=VARCHAR},",
          "lesson_valid = #{lessonValid,jdbcType=INTEGER}",
        "where lesson_id = #{lessonId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Lesson record);
}